package com.yourgroup.common.encryption;

import org.mindrot.jbcrypt.BCrypt;

public class PasswordEncoder {
    // 加密密码
    public static String encode(String rawPassword) {
        return BCrypt.hashpw(rawPassword, BCrypt.gensalt(10)); // 10轮哈希
    }

    // 验证密码
    public static boolean matches(String rawPassword, String encodedPassword) {
        return BCrypt.checkpw(rawPassword, encodedPassword);
    }
}

